#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

vector<int> bubblesort(vector<int> array){
    int round = 0;
    while(round != array.size()-1){
        for(int i = 0; i < array.size()-1; ++i){
            if(array[i] > array[i+1]){
                swap(array[i],array[i+1]);
            }
        }
        round = round + 1;
    }
    return array;
}

int main(int argc, char const *argv[])
{
    vector<int> arr {8, 5, 2, 9, 6, 3};
    auto sort = bubblesort(arr);
    for (auto n : sort){
        cout<<n<<" ";
    }
    cout << endl; 
    return 0;
}
